package com.ct.MapStruct.ConvertDOToModel;


import com.ct.MapStruct.Model.UserDTOMapStruct;
import com.ct.MapStruct.Model.UserMapStruct;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;


@Mapper
public interface UserConvertDOToModel {
    /**
     * 获取该类自动生成的实现类的实例
     */
    UserConvertDOToModel INSTANCES = Mappers.getMapper(UserConvertDOToModel.class);


    @Mappings({
            @Mapping(source = "userMapStruct.userName",target = "name"),
            @Mapping(target = "updateAt", expression = "java(com.ct.MapStruct.ConvertDOToModel.DateTransform.dateToStr(userMapStruct.getUpdateTime()))")
    })
    UserDTOMapStruct convert(UserMapStruct userMapStruct);


}
